cc.Class({
    extends: cc.Component,

    properties: {},


    onLoad () {
        let size = cc.view.getVisibleSize();
        this.node.width = size.width;
        this.node.height = size.height;

        this.node.on(cc.Node.EventType.TOUCH_MOVE, (event) => {
            let nodes = this.node.getChildren();
            for (let i = 0; i < nodes.length; i++) {
                let node = nodes[i];
                let x = node.x;
                let y = node.y;
                x += event.getDeltaX();
                y += event.getDeltaY();
                node.setPosition(x, y);

                let prefabUUID = node.prefabUUID;
                if (prefabUUID) {
                    window.TestScene._posMap[prefabUUID] = cc.v2(x, y);
                    cc.sys.localStorage.setItem('pos', JSON.stringify(window.TestScene._posMap));
                }
            }
        });
    },

    start () {

    },

    // update (dt) {},
});
